Optimal. Leaf size=71 \[ \frac {a^2 x}{c^2}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3988, 3862,
4004, 3879, 3881, 3882} \begin {gather*} -\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {a^2 x}{c^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3862
Rule 3879
Rule 3881
Rule 3882
Rule 3988
Rule 4004
Rubi steps
\begin {align*} \int \frac {(a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^2} \, dx &=\frac {\int \left (\frac {a^2}{(1-\sec (e+f x))^2}+\frac {2 a^2 \sec (e+f x)}{(1-\sec (e+f x))^2}+\frac {a^2 \sec ^2(e+f x)}{(1-\sec (e+f x))^2}\right ) \, dx}{c^2}\\ &=\frac {a^2 \int \frac {1}{(1-\sec (e+f x))^2} \, dx}{c^2}+\frac {a^2 \int \frac {\sec ^2(e+f x)}{(1-\sec (e+f x))^2} \, dx}{c^2}+\frac {\left (2 a^2\right ) \int \frac {\sec (e+f x)}{(1-\sec (e+f x))^2} \, dx}{c^2}\\ &=-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}-\frac {a^2 \int \frac {-3-\sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}\\ &=\frac {a^2 x}{c^2}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}+\frac {\left (4 a^2\right ) \int \frac {\sec (e+f x)}{1-\sec (e+f x)} \, dx}{3 c^2}\\ &=\frac {a^2 x}{c^2}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))^2}-\frac {4 a^2 \tan (e+f x)}{3 c^2 f (1-\sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.06, size = 53, normalized size = 0.75 \begin {gather*} -\frac {2 a^2 \cot ^3\left (\frac {e}{2}+\frac {f x}{2}\right ) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};-\tan ^2\left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 c^2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 47, normalized size = 0.66
method | result | size |
derivativedivides | \(\frac {2 a^{2} \left (\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f \,c^{2}}\) | \(47\) |
default | \(\frac {2 a^{2} \left (\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {1}{3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f \,c^{2}}\) | \(47\) |
risch | \(\frac {a^{2} x}{c^{2}}+\frac {8 i a^{2} \left (3 \,{\mathrm e}^{2 i \left (f x +e \right )}-3 \,{\mathrm e}^{i \left (f x +e \right )}+2\right )}{3 f \,c^{2} \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{3}}\) | \(59\) |
norman | \(\frac {\frac {a^{2} x \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}+\frac {2 a^{2}}{3 c f}-\frac {8 a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 c f}+\frac {2 a^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}-\frac {a^{2} x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}}{c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}\) | \(126\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 188 vs.
\(2 (67) = 134\).
time = 0.52, size = 188, normalized size = 2.65 \begin {gather*} \frac {a^{2} {\left (\frac {12 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c^{2}} + \frac {{\left (\frac {9 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}\right )} - \frac {a^{2} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}} + \frac {2 \, a^{2} {\left (\frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{3}}{c^{2} \sin \left (f x + e\right )^{3}}}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.82, size = 94, normalized size = 1.32 \begin {gather*} \frac {8 \, a^{2} \cos \left (f x + e\right )^{2} + 4 \, a^{2} \cos \left (f x + e\right ) - 4 \, a^{2} + 3 \, {\left (a^{2} f x \cos \left (f x + e\right ) - a^{2} f x\right )} \sin \left (f x + e\right )}{3 \, {\left (c^{2} f \cos \left (f x + e\right ) - c^{2} f\right )} \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {a^{2} \left (\int \frac {2 \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {1}{\sec ^{2}{\left (e + f x \right )} - 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 57, normalized size = 0.80 \begin {gather*} \frac {\frac {3 \, {\left (f x + e\right )} a^{2}}{c^{2}} + \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a^{2}\right )}}{c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.39, size = 40, normalized size = 0.56 \begin {gather*} \frac {a^2\,\left (-2\,{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+6\,\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+3\,f\,x\right )}{3\,c^2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________